All Functions of Week 8

mean

{base}

Get mean of a vector

lag

{dplyr}

Shift values in a vector or time series

coeftest

{lmtest}

Inference for Estimated Coefficients

cat

{base}

Concatenate and print objects to the console without quotes or indices

sqrt

{base}

Square-root function

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

c

{base}

Combine values/vectors into a vector

list

{base}

Create a list object

unlist

{base}

Flattens a list into a vector by extracting all its elements

coef

{stats}

Extract model coefficients

modelsummary

{modelsummary}

Creates regression and data tables

log

{base}

log (default base = e)

round

{base}

Rounds numbers

mutate

{dplyr}

Create new variables

matrix

{base}

Creates a matrix from the given set of values.

nobs

{stats}

Return the number of observations in a model object

diag

{base}

Extract or construct diagonal elements or matrices

ungroup

{dplyr}

Resolve grouping created with “group_by”

head

{utils}

Show first 5 rows of a data frame

is.na

{base}

Check if a value is NA/elements of vector are NA

roc

{pRoc}

Create a Receiver Operating Characteristic (ROC) curve

factor

{base}

Create a factor

as.data.frame

{base}

Functions to check if an object is a data frame, or coerce it if possible.

order

{base}

Get indexes that will sort a vector

library

{base}

Load an R package

group_tt

{tinytable}

Grouping in tinytable

t

{base}

Transpose a matrix or data frame

summary

{base}

Obtain summary statistics or detailed regression output

filter

{dplyr}

Filter out rows of a data frame according to logical vector

predict

{stats}

Generate predicted values from model objects

as.numeric

{base}

Coerce a vector to numeric

factor

{base}

Create factor variables

names

{base}

Get or set names of an object

binomial

{base}

Family argument in glm()

glm

{base}

Fits generalized linear models

theme_latex

{tinytable}

A theme for modelsummary/tinytable tables

plot

{graphics}

Generic function from base R to produce a plot

length

{base}

Returns number of elements in an object

tibble

{tibble}

A modern data frame from the tidyverse

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

attr

{base}

Access or modify the attributes of an object

auc

{pRoc}

Returns the area under the curve

The end!